package com.bdilab.iot.service.impl;

import com.bdilab.iot.dao.SysLogMapper;
import com.bdilab.iot.model.SysLog;
import com.bdilab.iot.service.SysLogService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.AsyncResult;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.concurrent.TimeUnit;

/**
 * @author WangNing
 * @version 1.0
 * @date 2020/8/1 15:08
 */
@Service
@Slf4j
public class SysLogServiceImpl  implements SysLogService {

    @Resource
    SysLogMapper sysLogMapper;

    @Override
    @Async("logExecutor")
    public void saveLog(SysLog sysLog) {

        sysLogMapper.insert(sysLog);

    }
}
